package com.bitoon.basketdudes.jpa;

import javax.servlet.*;

public class PersistenceAppListener implements ServletContextListener {

  public void contextInitialized(ServletContextEvent evt) {
  }

  public void contextDestroyed(ServletContextEvent evt) {
    String catalogos[] = {"jpa_catalogo", "jpa_basket"};
    
    PersistenceManager.getInstance().closeEntityManagerFactory(catalogos[0]);
    PersistenceManager.getInstance().closeEntityManagerFactory(catalogos[1]);
  }
}